<?php
namespace Api\Controller;

use Api\Model\ScoreModel;

class ScoreController extends BaseController
{
    /**
     * 结算分数
     */
    public function countScore()
    {
        $post = I('post.');
        $ip = $post['ip'];
        $cname = $post['cname'];
        $score = $post['score'];
        if($ip && $score){
            $score_model = new ScoreModel();
            $result =  $score_model->add_score_data($ip,$cname,$score);
            if($result['res'] == false){
                $this->fail_return(500,'error');
            }
            $this->success_return(['score'=>$score]);
        }

    }
}